<template>
	<view class="ljapp article">
		<view class="tit">{{obj.title}}</view>
		<view class="con u-flex">
			<view>{{$u.timeFormat(obj.createtime,'yyyy-mm-dd hh:MM')}}</view>
			<view class="volume">{{obj.volume}}次浏览</view>
		</view>
		<view class="content">
			<rich-text :nodes="obj.content"></rich-text>
		</view>
		
		<navigator hover-class="none" :url="'/pagesA/ask/inquiry?id='+obj.doctor.id" class="doctor-info u-flex u-flex-between u-flex-y-center">
			<view class="u-flex u-flex-y-center">
				<image class="avatar" :src="$base.cdn(obj.doctor.img)" mode="aspectFill"></image>
				<view class="name">{{obj.doctor.name}}</view>
				<view>{{obj.doctor.academic_title}}</view>
			</view>
			<view class="u-flex">
				<view style="margin-right: 20rpx;">医生详情</view>
				<u-icon name="arrow-right" color="#0b7b77"></u-icon>
			</view>
		</navigator>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				obj: {},
			}
		},
		onLoad(options) {
			if(options.id) this.obj.id = options.id
			this.init();
		},
		methods: {
			//详情
			init() {
				if(!this.obj.id) return false
				
				this.$Http({
					url: 'doctorArticle',
					load: false,
					data: {id:this.obj.id},
				}).then(res => {
					this.loading = false
					if (res.code == 1) {
						this.obj = res.data
					}else{
						this.$u.toast(res.msg)
					}
				});
				uni.pageScrollTo({
					scrollTop: 0,
					duration: 100,
				});
			},
		}
	}
</script>

<style lang="less">
	@import '@/pagesD/style.less';
	
	page{
		background-color: #fff;
	}
	
	/deep/uni-rich-text{
		color: #666666;
		font-size: 26rpx;
		
		img{
			max-width: 100%;
			display: block;
		}
	}
</style>
